import {EChartsType} from "echarts/types/dist/echarts";

export interface SeriesData {
  name: string;
  value: number;
}

export interface SeriesDataLine1 {
  name: string;
  value1: number;
  value2?: number;
  value3?: number;
  value4?: number;
  value5?: number;
  value6?: number;
  // ....数量取决于 legendItem
}

export interface Bie1Params extends BaseParams {
  seriesData: SeriesData[];
}

export interface Line1Params extends BaseParams {
  seriesData: SeriesDataLine1[];
  legendItem: string[];
}

export interface Bar1Params extends BaseParams {
  seriesData: SeriesDataLine1[];
  legendItem: string[];
}

export interface BarAndLine1Params extends BaseParams {
  legendItem: string[];
  seriesData: SeriesDataLine1[];
  indexBar: number; // 前几个legendItem渲染为柱状图
}

export interface BaseParams extends DefaultParams {
  el: MyHtmlElement;
}

export interface DefaultParams {
  titleShow?: boolean;
  showLegend?: boolean;
  formatter?: any;
  xAxisName?: string;
  yAxisName?: string;
  yAxisNameAppend?: string;
  yAxisName2?: string;
  yAxisNameAppend2?: string;
  titleText?: string;
}


export interface MyHtmlElement extends HTMLElement {
  __echart?: EChartsType
}
